<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWorkOrderApplyManagerSubmitHistory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('work_order_apply_manager_submit_history', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("applyManagerId")->default(0)->comment("work_order_apply_manager.id");
            $table->unsignedBigInteger("type")->default(0)->comment("提交类型 1 - 备注 2 - 解决方案");
            $table->text("content")->comment("提交内容");

            $table->string('createdUsername', 64)->default("")->comment('创建用户昵称');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->tinyInteger('isDeleted')->default(0);

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '工单备注&解决方案提交记录';
            $table->index(["applyManagerId"], "idx_applyManagerId");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('work_order_apply_manager_submit_history');
    }
}
